<!DOCTYPE html>
<html lang="en">
<head th:include="fragments/_header :: _head('科豆后台管理系统')"></head>
<body>
    <div class="login-box animated rotateIn">
        <div class="input-box">
            <form class="layui-form" action="">
                <input type="text" name="username" required lay-verify="required" placeholder="邮箱/手机号/平台账号" autocomplete="off" class="layui-input">
                <input type="password" name="password" required lay-verify="required" placeholder="密码" autocomplete="off" class="layui-input">
                <input type="submit" value="登 录" lay-submit lay-filter="login">
            </form>
            <div class="oauth"></div>
        </div>
    </div>
    <!--js逻辑-->
    <link rel="stylesheet" href="/css/okadmin.css">
    <link rel="stylesheet" href="/css/login.css"/>
    <link rel="stylesheet" href="https://cdn.bootcss.com/animate.css/3.5.2/animate.min.css"/>
    <div th:include="fragments/_footer :: _footer"></div>
    <script>
		NProgress.start();
		window.onload = function() {
		    NProgress.done();
		}
        layui.use(['form', 'jquery'], function () {
            var form = layui.form;
            var $ = layui.jquery;

            form.on('submit(login)', function (data) {
                $.post("/login", data.field, function (res) {
                    if (res.success) {
                        window.location = "/";
                    } else {
                        parent.layer.alert(res.data.errMsg);
                    }
                }, 'json');
                return false;
            });
        });
    </script>
</body>
</html>